import 'package:yp/helper.dart';
import 'package:yp/services/api.dart';
import 'package:get/get.dart';
import 'package:sp_util/sp_util.dart';

import 'state.dart';

class RefundProgressLogic extends GetxController {
  final state = RefundProgressState();
  @override
  void onInit() {
    super.onInit();

  }

  @override
  void onReady() {
    super.onReady();
   state.id = Get.arguments['id'];
     print('订单id');
    print(state.id);
    var params = {
      'tml_num_id': state.id,
      'tml_type': 1,
    };

    Api.tkjd(params).listen((event) {
      if(event['code'] == 0){
           state.list = event['operate_his'];
      }else{
        toast(event['message']);
        Get.back();
      }

      update();
    });
  }
}
